﻿<%
option explicit
session.codepage=65001
response.charset="utf-8"

sub echo(byval t0)
	response.write t0
end sub

sub flushs()
	response.flush()
end sub

sub alert(byval t0)
	echo "<script>Dialog.alert("""&t0&"！"",function(){location.href='javascript:history.go(-1)';});</script>"
	response.end()
end sub

function getrnd(byval t0)
	randomize
	dim n1,n2,n3
	do while len(getrnd)<t0 '随机字符位数 
		n1=cstr(chrw((57-48)*rnd+48)) '0~9 
		n2=cstr(chrw((90-65)*rnd+65)) 'a~z 
		n3=cstr(chrw((122-97)*rnd+97)) 'a~z 
		getrnd=getrnd&n1&n2&n3 
	loop
end function

function isinstall(byval t0)
	err.clear
	on error resume next
	isinstall=false
	dim obj
	set obj=server.createobject(t0)
		if err.number=0 then isinstall=true
	set obj=nothing
	err.clear()
end function

function loadfile(byval t0)
	err.clear
	on error resume next
	dim t1,stm
	set stm=server.createobject("adodb.stream")
	with stm
		.type=2'以本模式读取
		.mode=3 
		.charset="utf-8"
		.open
		.loadfromfile server.mappath(t0)
		t1=.readtext
		.close
	end with
	if err then
		loadfile="<p class=""red"">读取文件失败，具体原因为:"&err.description&"</p>"
		err.clear
	else
		loadfile=t1
	end if
	set stm=nothing
end function

sub newfile(byval t0,byval t1,byval t2,byval t3)
	err.clear
	on error resume next
	dim stm
	set stm=server.createobject("adodb.stream")
	with stm
		.type=2'以本模式读取
		.mode=3
		.charset=t3
		.open
		.writetext t2
		.savetofile server.mappath(t0&t1),2
		.close
	end with
	if err then
		if instr(t0&t1,".htaccess")<0 then echo "<p class=""red"">保存文件("&t0&t1&")失败，具体原因为:"&err.description&"</p>"
		err.clear
	end if
	set stm=nothing
end sub

'移动文件夹
function moveFolder(oldFolder,newFolder)
	dim voldFolder,vnewFolder,objFso
	voldFolder = oldFolder : vnewFolder = newFolder
	on error resume next
	set objFso = server.createobject("Scripting.FileSystemObject")
	if voldFolder <> vnewFolder then
		voldFolder=server.mappath(oldFolder) : vnewFolder=server.mappath(newFolder)
		if not objFso.FolderExists(vnewFolder) then createFolder newFolder,"folderdir" 
		if  objFso.FolderExists(voldFolder) then objFso.CopyFolder voldFolder,vnewFolder : objFso.DeleteFolder(voldFolder)
		if Err then moveFolder = false : echoMsg 0,Err.number,err_moveFolder else moveFolder = true
	end if
end function

function get_sys_dir()
	dim t0
	t0=lcase(left(request.servervariables("script_name"),instrrev(request.servervariables("script_name"),"/")-1))
	get_sys_dir=replace(t0,"/install","")&"/"
end function

function getip()
	getip=request.servervariables("HTTP_X_FORWARDED_FOR")
	if getip="" then getip=request.servervariables("REMOTE_ADDR")
	if not(checkstr(getip,"ip")) then getip="unknow"
end function

function checkstr(byval t0,byval t1)
	dim t2, regEx
	select case t1
		case "null":checkstr=is_null(t0):exit function
		case "en":t2="^[a-zA-Z]+$"
		case "cn":t2="^[\u4e00-\u9fa5]+$"
		case "int":t2="^[-\+]?\d+$"
		case "price":t2="^\d+(\.\d+)?$"
		case "username":t2="^[a-zA-Z0-9_]{5,20}$"
		case "password":t2="^[a-zA-Z0-9.]{6,16}$"
		case "email":t2="^[\w\-\.]+@[a-zA-Z0-9]+\.(([a-zA-Z0-9]{2,4})|([a-zA-Z0-9]{2,4}\.[a-zA-Z]{2,4}))$"
		case "date":checkstr=isdate(t0):exit function
		case "qqemail":t2="^[\w\-\.]+@qq.com"
		case "tel":t2="^((\(\+?\d{2,3}\))|(\+?\d{2,3}\-))?(\(0?\d{2,3}\)|0?\d{2,3}-)?[1-9]\d{4,7}(\-\d{1,4})?$"
		case "mobile":t2="^(\+?\d{2,3})?0?1(3\d|5\d|7[0]|8[0256789])\d{8}$"
		case "zipcode":t2="^\d{6}$"
		case "qq":t2="^[1-9]\d{4,15}$"
		case "url":t2 = "^(http|https|ftp):\/\/[a-zA-Z0-9]+\.[a-zA-Z0-9]+[\/=\?%\-&_~`@[\]\':+!]*([^<>\""])*$"
		case "ip":t2="^((25[0-5]|2[0-4]\d|(1\d|[1-9])?\d)\.){3}(25[0-5]|2[0-4]\d|(1\d|[1-9])?\d)$"
		case "file":t2="^[a-zA-Z0-9/_-]{1,50}$"
		case "filename":t2="^[a-zA-Z0-9._/]{1,50}$"
		case "urlname":t2="^[a-zA-Z0-9]{1,50}$"
	end select
	Set regEx = New RegExp
	regEx.IgnoreCase = True
	regEx.Global = True
	regEx.MultiLine = True
	regEx.pattern=t2
	checkstr=regEx.test(trim(t0))
end function

sub load_config(byval t0,byval t1,byval t2,byval t3,byval t4,byval t5,byval t6,byval t7)
	'读取程序配置
	if t0.execute("select count(1) from Config")(0)=0 then
		t0.execute("insert into Config values(1,'"&t1&"','"&t2&"','"&t3&"','Scripting.FileSystemObject','"&t4&"','"&t5&"','images/logo.gif','379','68','zhaoxunzhiyin','zhaoxunzhiyin','zhaoxunzhiyin@163.com',0,'Show.asp','Show.html',0,'Index.asp','Index.html','"&t6&"','show.html','DefaultSkin.css','','DefaultSkin.css','Copyright &copy; 2006-<script language=""JavaScript"">document.write(new Date().getFullYear());</script> <a href=""http://www.kaixin100.cn/"" target=""_blank""><b><font face=Arial>www.</font><font face=Arial color=""#CC3300"">kaixin100</font><font face=""Arial"">.cn</font></b></a> All Rights Reserved.',1,'000000000000000000000000','网站正在维护……','妈妈的=**的|我靠=我*|fuck=****|bitch=*****|他妈的=他*的|法轮功=****|法轮=**|falundafa=****|falun=****|江泽民=****|操你妈=***|傻B=**|猪=**|反共=**|国民党=****|共匪=**|台独=**|性爱=**|三级片=我该死|卖淫=**|鸡巴=**|操你=*你|干你=*你|日你=*你|sex=***|屁=*|腚=*|妓=*|娼=*|阴蒂=*|奸=*|尻=*|贱=*|婊=*|靠=*|叉=*|龟头=**|屄=*|赑=*|妣=*|肏=*|尻=*|屌=*|AIOCMS=*|盗版=*|随缘=*','61.144.79.76|61.53.234.246|219.149.153.138|218.65.204.10|202.101.212.122|220.197.192.28|218.23.159.76|218.1.88.54','"&t7&"','20',0,1,1,1,'Databackup','0,Upload,{yyyy}{mm}{dd}/,png|jpg|jpeg|gif|bmp,cookie|.getfolder|.createfolder|.deletefolder|.createdirectory|.deletedirectory|.saveaswscript.shell|script.encode|folderfath|session,999,120,90,0,2,金宇世纪,18,FFFFFF,Arial Black,1,{$InstallDir}images/logo.gif,1,959595,200,200,4,2048,flv|swf|mkv|avi|rm|rmvb|mpeg|mpg|ogg|ogv|mov|wmv|mp4|webm|mp3|wav|mid,rar|zip|tar|gz|7z|bz2|cab|iso|doc|docx|xls|xlsx|ppt|pptx|pdf|txt|md|xml,100',0,'smtp.163.com','zhaoxunzhiyin@163.com','111111','163.com')")
	end if
	echo "<p>程序配置数据写入成功</p>"
	flushs
end sub

sub load_menu_xml(byval t0)
	'读取管理菜单
	if t0.execute("select count(1) from Admin_Auth")(0)>0 then
		echo "<p>程序管理数据写入成功</p>"
		flushs
		exit sub
	end if
	dim xml,item,i,AuthID,title,href,types,status,authopen,icon,pid,sort,addtime,menustatus
	set xml=server.createobject("microsoft.xmldom")
	xml.async=false
	xml.load(server.mappath("xml/menu.xml"))
	set item=xml.getElementsByTagName("item")
	for i=0 to (item.length-1)
		set AuthID=item.item(i).getElementsByTagName("AuthID")
		set title=item.item(i).getElementsByTagName("title")
		set href=item.item(i).getElementsByTagName("href")
		set types=item.item(i).getElementsByTagName("type")
		set status=item.item(i).getElementsByTagName("status")
		set authopen=item.item(i).getElementsByTagName("authopen")
		set icon=item.item(i).getElementsByTagName("icon")
		set pid=item.item(i).getElementsByTagName("pid")
		set sort=item.item(i).getElementsByTagName("sort")
		set addtime=item.item(i).getElementsByTagName("addtime")
		set menustatus=item.item(i).getElementsByTagName("menustatus")
		t0.execute("insert into Admin_Auth values("&AuthID.item(0).Text&",'"&title.item(0).Text&"','"&replace(href.item(0).Text,"%26","&")&"',"&types.item(0).Text&","&status.item(0).Text&","&authopen.item(0).Text&",'"&icon.item(0).Text&"',NULL,"&pid.item(0).Text&","&sort.item(0).Text&",'"&addtime.item(0).Text&"',NULL,"&menustatus.item(0).Text&")")
	next
	set xml=nothing
	set item=nothing
	echo "<p>程序管理数据写入成功</p>"
	flushs
end sub

sub load_model_xml(byval t0)
	'读取模型
	if t0.execute("select count(1) from Channel")(0)>0 then
		echo "<p>模型数据写入成功</p>"
		flushs
		exit sub
	end if
	dim xml,item,i
	dim ChannelID,ChannelName,ChannelPicUrl,ChannelRemark,ChannelColor,ChannelBold,ChannelOpenType,ChannelHidden,ChannelType,LinkUrl,ChannelOrder,ModuleType,ChannelDir,ChannelTit,ChannelDataName,ChannelUnit,ChannelListNum,ShowName,ChannelSetup,ClassDepth,ChannelPosition,ChannelPut,UploadType,MaxFileSize,PicWidth,PicHeight,UpFileType,CuteNum,LeftCuteNum,ChannelCount,ChannelHits,ChannelOption,UploadDir,ChannelReward,ChannelDates,RssField,ChannelPower,ChannelPHidden,IsCreateHtml,HtmlExtName,HtmlPrefix,HtmlPath,HtmlForm,Moban,SkinID,TemplateID
	set xml=server.createobject("microsoft.xmldom")
	xml.async=false
	xml.load(server.mappath("xml/model.xml"))
	set item=xml.getElementsByTagName("item")
	for i=0 to (item.length-1)
		set ChannelID=item.item(i).getElementsByTagName("ChannelID")
		set ChannelName=item.item(i).getElementsByTagName("ChannelName")
		set ChannelPicUrl=item.item(i).getElementsByTagName("ChannelPicUrl")
		set ChannelRemark=item.item(i).getElementsByTagName("ChannelRemark")
		set ChannelColor=item.item(i).getElementsByTagName("ChannelColor")
		set ChannelBold=item.item(i).getElementsByTagName("ChannelBold")
		set ChannelOpenType=item.item(i).getElementsByTagName("ChannelOpenType")
		set ChannelHidden=item.item(i).getElementsByTagName("ChannelHidden")
		set ChannelType=item.item(i).getElementsByTagName("ChannelType")
		set LinkUrl=item.item(i).getElementsByTagName("LinkUrl")
		set ChannelOrder=item.item(i).getElementsByTagName("ChannelOrder")
		set ModuleType=item.item(i).getElementsByTagName("ModuleType")
		set ChannelDir=item.item(i).getElementsByTagName("ChannelDir")
		set ChannelTit=item.item(i).getElementsByTagName("ChannelTit")
		set ChannelDataName=item.item(i).getElementsByTagName("ChannelDataName")
		set ChannelUnit=item.item(i).getElementsByTagName("ChannelUnit")
		set ChannelListNum=item.item(i).getElementsByTagName("ChannelListNum")
		set ShowName=item.item(i).getElementsByTagName("ShowName")
		set ChannelSetup=item.item(i).getElementsByTagName("ChannelSetup")
		set ClassDepth=item.item(i).getElementsByTagName("ClassDepth")
		set ChannelPosition=item.item(i).getElementsByTagName("ChannelPosition")
		set ChannelPut=item.item(i).getElementsByTagName("ChannelPut")
		set UploadType=item.item(i).getElementsByTagName("UploadType")
		set MaxFileSize=item.item(i).getElementsByTagName("MaxFileSize")
		set PicWidth=item.item(i).getElementsByTagName("PicWidth")
		set PicHeight=item.item(i).getElementsByTagName("PicHeight")
		set UpFileType=item.item(i).getElementsByTagName("UpFileType")
		set CuteNum=item.item(i).getElementsByTagName("CuteNum")
		set LeftCuteNum=item.item(i).getElementsByTagName("LeftCuteNum")
		set ChannelCount=item.item(i).getElementsByTagName("ChannelCount")
		set ChannelHits=item.item(i).getElementsByTagName("ChannelHits")
		set ChannelOption=item.item(i).getElementsByTagName("ChannelOption")
		set UploadDir=item.item(i).getElementsByTagName("UploadDir")
		set ChannelReward=item.item(i).getElementsByTagName("ChannelReward")
		set ChannelDates=item.item(i).getElementsByTagName("ChannelDates")
		set RssField=item.item(i).getElementsByTagName("RssField")
		set ChannelPower=item.item(i).getElementsByTagName("ChannelPower")
		set ChannelPHidden=item.item(i).getElementsByTagName("ChannelPHidden")
		set IsCreateHtml=item.item(i).getElementsByTagName("IsCreateHtml")
		set HtmlExtName=item.item(i).getElementsByTagName("HtmlExtName")
		set HtmlPrefix=item.item(i).getElementsByTagName("HtmlPrefix")
		set HtmlPath=item.item(i).getElementsByTagName("HtmlPath")
		set HtmlForm=item.item(i).getElementsByTagName("HtmlForm")
		set Moban=item.item(i).getElementsByTagName("Moban")
		set SkinID=item.item(i).getElementsByTagName("SkinID")
		set TemplateID=item.item(i).getElementsByTagName("TemplateID")
		t0.execute("insert into Channel values("&ChannelID.item(0).Text&",'"&ChannelName.item(0).Text&"','"&ChannelPicUrl.item(0).Text&"','"&ChannelRemark.item(0).Text&"','"&ChannelColor.item(0).Text&"','"&ChannelBold.item(0).Text&"','"&ChannelOpenType.item(0).Text&"','"&ChannelHidden.item(0).Text&"','"&ChannelType.item(0).Text&"','"&LinkUrl.item(0).Text&"','"&ChannelOrder.item(0).Text&"','"&ModuleType.item(0).Text&"','"&ChannelDir.item(0).Text&"','"&ChannelTit.item(0).Text&"','"&ChannelDataName.item(0).Text&"','"&ChannelUnit.item(0).Text&"','"&ChannelListNum.item(0).Text&"','"&ShowName.item(0).Text&"','"&ChannelSetup.item(0).Text&"','"&ClassDepth.item(0).Text&"','"&ChannelPosition.item(0).Text&"','"&ChannelPut.item(0).Text&"','"&UploadType.item(0).Text&"','"&MaxFileSize.item(0).Text&"','"&PicWidth.item(0).Text&"','"&PicHeight.item(0).Text&"','"&UpFileType.item(0).Text&"','"&CuteNum.item(0).Text&"','"&LeftCuteNum.item(0).Text&"','"&ChannelCount.item(0).Text&"','"&ChannelHits.item(0).Text&"','"&ChannelOption.item(0).Text&"','"&UploadDir.item(0).Text&"','"&ChannelReward.item(0).Text&"','"&ChannelDates.item(0).Text&"','"&RssField.item(0).Text&"','"&ChannelPower.item(0).Text&"','"&ChannelPHidden.item(0).Text&"','"&IsCreateHtml.item(0).Text&"','"&HtmlExtName.item(0).Text&"','"&HtmlPrefix.item(0).Text&"','"&HtmlPath.item(0).Text&"','"&HtmlForm.item(0).Text&"','"&Moban.item(0).Text&"','"&SkinID.item(0).Text&"','"&TemplateID.item(0).Text&"')")
	next
	set xml=nothing
	set item=nothing
	echo "<p>模型数据写入成功</p>"
	flushs
end sub

sub load_city_xml(byval t0)
	'读取城市菜单
	if t0.execute("select count(1) from City")(0)>0 then
		echo "<p>城市数据写入成功</p>"
		flushs
		exit sub
	end if
	dim xml,item,i,Id,Country,Province,City,Area,PostCode,AreaCode
	set xml=server.createobject("microsoft.xmldom")
	xml.async=false
	xml.load(server.mappath("xml/city.xml"))
	set item=xml.getElementsByTagName("item")
	for i=0 to (item.length-1)
		set Id=item.item(i).getElementsByTagName("Id")
		set Country=item.item(i).getElementsByTagName("Country")
		set Province=item.item(i).getElementsByTagName("Province")
		set City=item.item(i).getElementsByTagName("City")
		set Area=item.item(i).getElementsByTagName("Area")
		set PostCode=item.item(i).getElementsByTagName("PostCode")
		set AreaCode=item.item(i).getElementsByTagName("AreaCode")
		t0.execute("insert into City values("&Id.item(0).Text&",'"&Country.item(0).Text&"','"&Province.item(0).Text&"','"&City.item(0).Text&"','"&Area.item(0).Text&"','"&PostCode.item(0).Text&"','"&AreaCode.item(0).Text&"')")
	next
	set xml=nothing
	set item=nothing
	echo "<p>城市数据写入成功</p>"
	flushs
end sub

sub load_count(byval t0)
	'读取计数
	if t0.execute("select count(1) from [Count]")(0)=0 then
		t0.execute("insert into [Count](ID,Cpath,Style,Hits) values(1,'1','4',0)")
	end if
	echo "<p>计数数据写入成功</p>"
	flushs
end sub

sub load_dictionary_xml(byval t0)
	'读取字典
	if t0.execute("select count(1) from Dictionary")(0)>0 then
		echo "<p>字典数据写入成功</p>"
		flushs
		exit sub
	end if
	dim xml,item,i,FieldID,Title,TableName,FieldName,FieldValue
	set xml=server.createobject("microsoft.xmldom")
	xml.async=false
	xml.load(server.mappath("xml/dictionary.xml"))
	set item=xml.getElementsByTagName("item")
	for i=0 to (item.length-1)
		set FieldID=item.item(i).getElementsByTagName("FieldID")
		set Title=item.item(i).getElementsByTagName("Title")
		set TableName=item.item(i).getElementsByTagName("TableName")
		set FieldName=item.item(i).getElementsByTagName("FieldName")
		set FieldValue=item.item(i).getElementsByTagName("FieldValue")
		t0.execute("insert into Dictionary values("&FieldID.item(0).Text&",'"&Title.item(0).Text&"','"&TableName.item(0).Text&"','"&FieldName.item(0).Text&"','"&FieldValue.item(0).Text&"')")
	next
	set xml=nothing
	set item=nothing
	echo "<p>字典数据写入成功</p>"
	flushs
end sub

sub load_moban_xml(byval t0)
	'读取模板名称
	if t0.execute("select count(1) from Moban")(0)>0 then
		echo "<p>模板名称数据写入成功</p>"
		flushs
		exit sub
	end if
	dim xml,item,i,MobanID,MobanName,MobanGetName,MobanType
	set xml=server.createobject("microsoft.xmldom")
	xml.async=false
	xml.load(server.mappath("xml/moban.xml"))
	set item=xml.getElementsByTagName("item")
	for i=0 to (item.length-1)
		set MobanID=item.item(i).getElementsByTagName("MobanID")
		set MobanName=item.item(i).getElementsByTagName("MobanName")
		set MobanGetName=item.item(i).getElementsByTagName("MobanGetName")
		set MobanType=item.item(i).getElementsByTagName("MobanType")
		t0.execute("insert into Moban values("&MobanID.item(0).Text&",'"&MobanName.item(0).Text&"','"&MobanGetName.item(0).Text&"',"&MobanType.item(0).Text&")")
	next
	set xml=nothing
	set item=nothing
	echo "<p>模板名称数据写入成功</p>"
	flushs
end sub

sub load_pinyin_xml(byval t0)
	'读取拼音
	if t0.execute("select count(1) from PinYin")(0)>0 then
		echo "<p>拼音数据写入成功</p>"
		flushs
		exit sub
	end if
	dim xml,item,i,id,pinyin,content
	set xml=server.createobject("microsoft.xmldom")
	xml.async=false
	xml.load(server.mappath("xml/pinyin.xml"))
	set item=xml.getElementsByTagName("item")
	for i=0 to (item.length-1)
		set id=item.item(i).getElementsByTagName("id")
		set pinyin=item.item(i).getElementsByTagName("pinyin")
		set content=item.item(i).getElementsByTagName("content")
		t0.execute("insert into PinYin values("&id.item(0).Text&",'"&pinyin.item(0).Text&"','"&content.item(0).Text&"')")
	next
	set xml=nothing
	set item=nothing
	echo "<p>拼音数据写入成功</p>"
	flushs
end sub

sub load_group_xml(byval t0)
	'读取会员组
	if t0.execute("select count(1) from UserGroup")(0)>0 then
		echo "<p>会员组数据写入成功</p>"
		flushs
		exit sub
	end if
	dim xml,item,i
	dim GroupID,GroupName,GroupIntro,GroupType,arrClass_Browse,arrClass_View,arrClass_Input,GroupSetting
	set xml=server.createobject("microsoft.xmldom")
	xml.async=false
	xml.load(server.mappath("xml/group.xml"))
	set item=xml.getElementsByTagName("item")
	for i=0 to (item.length-1)
		set GroupID=item.item(i).getElementsByTagName("GroupID")
		set GroupName=item.item(i).getElementsByTagName("GroupName")
		set GroupIntro=item.item(i).getElementsByTagName("GroupIntro")
		set GroupType=item.item(i).getElementsByTagName("GroupType")
		set arrClass_Browse=item.item(i).getElementsByTagName("arrClass_Browse")
		set arrClass_View=item.item(i).getElementsByTagName("arrClass_View")
		set arrClass_Input=item.item(i).getElementsByTagName("arrClass_Input")
		set GroupSetting=item.item(i).getElementsByTagName("GroupSetting")
		t0.execute("insert into UserGroup values("&GroupID.item(0).Text&",'"&GroupName.item(0).Text&"','"&GroupIntro.item(0).Text&"','"&GroupType.item(0).Text&"','"&arrClass_Browse.item(0).Text&"','"&arrClass_View.item(0).Text&"','"&arrClass_Input.item(0).Text&"','"&GroupSetting.item(0).Text&"')")
	next
	set xml=nothing
	set item=nothing
	echo "<p>会员组数据写入成功</p>"
	flushs
end sub

sub load_admin(byval t0,byval t1,byval t2)
	if t0.execute("select count(1) from Admin")(0)=0 then
		t0.execute("insert into Admin values(1,'"&t1&"','"&t2&"',0,1,NULL,'"&getip()&"','"&Now()&"','"&Now()&"',0,'',1,'','',1)")
	end if
	echo "<p>管理员配置数据写入成功</p>"
	flushs
end sub

function check_competence(byval t0)
	check_competence=true
	t0=server.MapPath(t0)
	on error resume next
	dim fso,objfolder,objsubfolders
	set fso=server.createobject("scripting.filesystemobject")
	set objfolder=fso.getfolder(t0) 
	set objsubfolders=objfolder.subfolders 
	dim subfcount:subfcount=objsubfolders.count 
	if err.number<>0 then 
		subfcount=-1
		err.clear()
	end if
	if subfcount=-1 then 
		check_competence=false
		exit function
	else
		fso.createtextfile(t0&"\wangkaicms.asp") 
		if err then
			err.clear()
			check_competence=false
			exit function
		else
			dim stm
			set stm=server.createobject("adodb.stream")
			with stm
				.type=2
				.mode=3
				.charset="utf-8"
				.open
				.writetext "测试"
				.savetofile t0&"\test.asp",2
				.close
			end with
			if err then
				err.clear()
				check_competence=false
				exit function
			end if
			set stm=nothing
			fso.deletefile(t0&"\wangkaicms.asp") 
			if err.number<>0 then 
				err.clear()
				check_competence=false
				exit function
			end if
			fso.deletefile(t0&"\test.asp") 
			if err.number<>0 then 
				err.clear()
				check_competence=false
				exit function
			end if
		end if
	end if
	set objfolder=nothing
	set objsubfolders=nothing
	set fso=nothing
end function

function checkinstall()
	checkinstall=false
	dim fso
	set fso=server.createobject("scripting.filesystemobject")
	if fso.fileexists(server.mappath("Install.lock")) then
		checkinstall=true
		exit function
	end if
	set fso=nothing
end function
%>